// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { FieldItem, FieldItemNumber, FieldItemString, FieldItemId, FieldItemInt, UI, TFunc } from 'tonwa-react';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { Res, uqStringify, setRes } from "tonwa-core";
import { LogisticCenter } from "./BzTicket";

/*--fields--*/
const fields = {
	id: {
		"name": "id",
		"type": "id",
		"isKey": false,
		"label": "Id"
	} as FieldItemId,
	no: {
		"name": "no",
		"type": "string",
		"isKey": true,
		"widget": "string",
		"label": "No"
	} as FieldItemString,
	物流中心名称: {
		"name": "物流中心名称",
		"type": "string",
		"isKey": false,
		"widget": "string",
		"label": "物流中心名称"
	} as FieldItemString,
	物流中心编号: {
		"name": "物流中心编号",
		"type": "string",
		"isKey": false,
		"widget": "string",
		"label": "物流中心编号"
	} as FieldItemString,
	注册地址: {
		"name": "注册地址",
		"type": "string",
		"isKey": false,
		"widget": "string",
		"label": "注册地址"
	} as FieldItemString,
	法人姓名: {
		"name": "法人姓名",
		"type": "string",
		"isKey": false,
		"widget": "string",
		"label": "法人姓名"
	} as FieldItemString,
	物流员工人数: {
		"name": "物流员工人数",
		"type": "integer",
		"isKey": false,
		"widget": "updown",
		"label": "物流员工人数"
	} as FieldItemInt,
	联系电话: {
		"name": "联系电话",
		"type": "string",
		"isKey": false,
		"widget": "string",
		"label": "联系电话"
	} as FieldItemString,
	状态: {
		"name": "状态",
		"type": "integer",
		"isKey": false,
		"widget": "updown",
		"label": "状态"
	} as FieldItemInt,
};
/*==fields==*/

const fieldArr: FieldItem[] = [
	fields.no, fields.物流中心名称, fields.物流中心编号, fields.注册地址, fields.法人姓名, fields.物流员工人数, fields.联系电话, fields.状态, 
];

export const ui: UI = {
	label: "LogisticCenter",
	fieldArr,
	fields,
};

const resRaw: Res<any> = {
	$zh: {
	},
	$en: {
	}
};
const res: any = {};
setRes(res, resRaw);

export const t:TFunc = (str:string|JSX.Element): string|JSX.Element => {
	return res[str as string] ?? str;
}

export function render(item: LogisticCenter):JSX.Element {
	return <>{uqStringify(item)}</>;
};
